home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / tbbs / prgsourc.zip / HOMES.ZIP / LIST.PRG < prev    next >
Text File  |  1996-01-13  |  14KB  |  396 lines

  1. PROCEDURE list
  2.  
  3. SELECT a
  4. SET ORDER TO 1
  5. DO cls WITH 2,0,20,79                           
  6. SET COLOR TO R/R
  7. @ 0,0 CLEAR TO 1,60
  8. SET COLOR TO GR+/R
  9. @ 0,3 SAY city
  10. @ 0,Col()+1 SAY "Real Estate Listings in Area"
  11. @ 0,Col()+1 SAY larea
  12. SET COLOR TO W+/R 
  13. @ 0,73 SAY "LIST  "
  14. DO tl
  15.  
  16. PRIVATE crow
  17. PRIVATE page
  18.  
  19. crow=3                                           && current row=top row
  20. crec=1                                           && current record
  21.  
  22. SEEK larea                                       && Search for listings
  23. IF .NOT. Found()
  24.    SET COLOR TO W+/N
  25.    @ crow,5 SAY "No Listings in this area.          to return to area list." 
  26.    SET COLOR TO GR+/N
  27.    @ crow,31 SAY "<Escape>"
  28.    charin=" "
  29.    SET COLOR TO N/N
  30.    @ 2,0 GET charin
  31.    DO WHILE .T.
  32.       READ
  33.       IF LastKey() = 27
  34.          RETURN  
  35.       ENDIF
  36.   ENDDO    
  37. ENDIF
  38.  
  39. more=.T.
  40. less=.F.
  41. brow=1
  42. brec=0
  43.  
  44. DO nlist WITH brow,more,brec 
  45. page = brec
  46. SEEK larea                                       && Go to top index record 
  47. crow = 3                                         && current row=top row
  48. @ crow,9 SAY " $"
  49. @ crow,11 SAY price PICTURE "@B 9,999,999"
  50. charin=" "
  51. SET COLOR TO N/N
  52. @ 2,0 GET charin
  53. DO WHILE .NOT. EoF()
  54.         READ
  55.         DO CASE 
  56.            CASE LastKey() = 5                    && <Up Arrow>
  57.                 IF crow = 3                      && Already at top row?
  58.                      
  59.                      IF less                     && Back pages?
  60.                         SKIP -page               && Move pointer to top 
  61.                         more=.T.                 && There are now more pages
  62.                         SKIP -1                  && Just to test...
  63.                         
  64.                         IF BoF() .OR. area # larea
  65.                            less = .F.              
  66.                            IF area # larea
  67.                               SKIP
  68.                            ENDIF
  69.                         ELSE
  70.                            SKIP
  71.                         ENDIF
  72.                         
  73.                         DO cls WITH 2,0,20,79                  
  74.                         DO nlist WITH brow,more,brec
  75.                         crec=brec
  76.                         crow=brow
  77.                         @ crow,9 SAY " $"
  78.                         @ crow,11 SAY price PICTURE "@B 9,999,999"
  79.                         
  80.                      ENDIF
  81.                      
  82.                      LOOP
  83.                 ENDIF
  84.                 
  85.                 SET COLOR TO W+/N
  86.                 @ crow,9 SAY " $"
  87.                 @ crow,11 SAY price PICTURE "@B 9,999,999"
  88.                 crow=crow-1
  89.                 SKIP -1
  90.                 crec=crec-1
  91.                 SET COLOR TO GR+/B
  92.                 @ crow,9 SAY " $"
  93.                 @ crow,11 SAY price PICTURE "@B 9,999,999"
  94.                 LOOP
  95.            
  96.            CASE LastKey() = 13                   && <Enter>
  97.                 temp = crow
  98.                 DO tt
  99.                 DO vscr
  100.                 DO view
  101.                 SET COLOR TO N/N
  102.                 @ 2,0 GET charin
  103.                 DO WHILE Lastkey() # 27                   && <Esc>
  104.                    READ 
  105.                    IF LastKey() = 84  .OR.  LastKey() = 116    && 'T' or 't'
  106.                       DO tag WITH tg
  107.                    ENDIF
  108.                 ENDDO
  109.                 SET COLOR TO R/R
  110.                 @ 0,0 CLEAR TO 1,60
  111.                 SET COLOR TO GR+/R
  112.                 @ 0,3 SAY city
  113.                 @ 0,Col()+1 SAY "Real Estate Listings in Area"
  114.                 @ 0,Col()+1 SAY larea
  115.                 SET COLOR TO W+/R 
  116.                 @ 0,73 SAY "LIST  "
  117.                 DO reset
  118.                 RELEASE temp
  119.                 LOOP
  120.            
  121.            CASE LastKey() = 24                   && <Dn Arrow>
  122.                 IF crow = brow                   && Already at last row?
  123.                      IF more                     && More pages?
  124.                         SKIP                     && Top of new page
  125.                         crec=1              
  126.                         less=.T.                 && There are now back pages
  127.                         DO cls WITH 2,0,20,79                  
  128.                         DO nlist WITH brow,more,brec
  129.                         SKIP -(brec-1)
  130.                         crow = 3                   
  131.                         @ crow,9 SAY " $"
  132.                         @ crow,11 SAY price PICTURE "@B 9,999,999"
  133.                      ENDIF
  134.                      LOOP
  135.                 ENDIF
  136.                 
  137.                 SET COLOR TO W+/N
  138.                 @ crow,9 SAY " $"
  139.                 @ crow,11 SAY price PICTURE "@B 9,999,999"
  140.                 crow=crow+1
  141.                 SKIP
  142.                 crec=crec+1
  143.                 SET COLOR TO GR+/B
  144.                 @ crow,9 SAY " $"
  145.                 @ crow,11 SAY price PICTURE "@B 9,999,999"
  146.                 LOOP
  147.            
  148.            CASE LastKey() = 27                   && <Esc>
  149.                 EXIT
  150.            
  151.            CASE LastKey() = 63                   && `?': Help 
  152.                 temp = crow
  153.                 ptemp = pic1
  154.                 
  155.                 DO cls WITH 2,0,20,79
  156.                 SET COLOR TO GR+/N
  157.                 @ 3,3 SAY "<Enter>"
  158.                 @ 6,3 SAY "T" 
  159.                 @ 10,3 SAY "S" 
  160.                 @ 14,3 SAY "V" 
  161.                 SET COLOR TO BG/N
  162.                 @ 3,11 SAY "View highlited listing"
  163.                 @ 6,5 SAY "Tag/Untag for download/view"
  164.                 @ 10,5 SAY "Search, this area only"
  165.                 @ 14,5 SAY "View tagged listings"
  166.                 SET COLOR TO W+/N
  167.                 @ 4,3 SAY  "Shows the complete listing information available for the highlited home."
  168.                 @ 7,3 SAY "Marks the listing with a `*' and adds it to the queue for later" 
  169.                 @ 8,3 SAY "downloading or sequential viewing by use of the `D' and `V' keys"
  170.                 @ 11,3 SAY "Searches for listings on user-selected criterion in the currently"
  171.                 @ 12,3 SAY "selected area omly"
  172.                 @ 15,3 SAY "Shows same view as shown by <Enter>, but allows sequential viewing of up"
  173.                 @ 16,3 SAY "to 50 listings, with the option to add or remove the listing from the" 
  174.                 @ 17,3 SAY "download/viewing queue"
  175.                 @ 19,25 SAY "───── Any Key to Continue ─────"
  176.                 key = InKey(100)
  177.                 DO cls WITH 2,0,20,79
  178.                 SET COLOR TO GR+/N
  179.                 @ 3,3 SAY "D" 
  180.                 @ 8,3 SAY "?" 
  181.                 @ 11,3 SAY "<Esc>" 
  182.                 SET COLOR TO BG/N
  183.                 @ 3,5 SAY "Download pictures of highlited listing"
  184.                 @ 8,5 SAY "Help"
  185.                 @ 11,9 SAY "Area Screen"
  186.                 SET COLOR TO W+/N
  187.                 @ 4,3 SAY "Downloads up to four pictures of the highlited listing to your computer."
  188.                 @ 5,3 SAY "These may include an exterior view, an interior view, a floor plan, and"
  189.                 @ 6,3 SAY "a map of the property."
  190.                 @ 9,3 SAY "Displays this file."
  191.                 @ 12,3 SAY "Returns to previous screen, the area list."
  192.                 @ 14,25 SAY "───── Any Key to Continue ─────"
  193.                 key = InKey(100)
  194.                 
  195.                 SEEK larea
  196.                 DO WHILE pic1 # ptemp
  197.                    SKIP 
  198.                 ENDDO
  199.                 DO reset
  200.                 RELEASE temp,ptemp
  201.                 LOOP
  202.                 
  203.            CASE LastKey() = 68 .OR. LastKey() = 100      && D or d: Download
  204.                 temp = crow
  205.                 ptemp = pic1
  206.                 fl = 0
  207.                 IF pic
  208.                    fl = 1
  209.                 ENDIF
  210.                 IF map
  211.                    fl = fl + 1
  212.                 ENDIF
  213.                 IF pln
  214.                    fl = fl + 1
  215.                 ENDIF
  216.                 IF int
  217.                    fl = fl + 1
  218.                 ENDIF
  219.                 f1 = homes + pic1 + "PIC.GIF"
  220.                 f2 = homes + pic1 + "MAP.GIF"
  221.                 f3 = homes + pic1 + "PLN.GIF"
  222.                 f2 = homes + pic1 + "INT.GIF"
  223.                 DO BoxB WITH 7,18,10,50
  224.                 @ 8,20 SAY "Pictures to be downloaded: " + Ltrim(Str(fl))
  225.                 @ 9,20 SAY "Download now?"
  226.                 SET COLOR TO N/N
  227.                 @ 2,0 GET charin
  228.                 DO WHILE .T.
  229.                    READ
  230.                    DO CASE
  231.                       CASE LastKey() = 89 .OR. LastKey() = 121   && `Y' or `y'
  232.                            SET COLOR TO W+/N
  233.                            DO cls WITH 2,0,20,79
  234.                            IF File(f1)
  235.                               DOTBBS TYPE 34 OPTDATA "C:\HOMEBASE\PICS /I:" + Chr(34) + f1 + Chr(34)
  236.                            ENDIF
  237.                            IF File(f2)
  238.                               DOTBBS TYPE 34 OPTDATA "C:\HOMEBASE\PICS /I:" + Chr(34) + f2 + Chr(34)
  239.                            ENDIF
  240.                            IF File(f3)
  241.                               DOTBBS TYPE 34 OPTDATA "C:\HOMEBASE\PICS /I:" + Chr(34) + f3 + Chr(34)
  242.                            ENDIF
  243.                            IF File(f4)
  244.                               DOTBBS TYPE 34 OPTDATA "C:\HOMEBASE\PICS /I:" + Chr(34) + f4 + Chr(34)
  245.                            ENDIF
  246.                            RELEASE f1,f2,f3,f4
  247.                            EXIT
  248.  
  249.                       CASE LastKey() = 78 .OR. LastKey() = 110   && 'N' or 'n'
  250.                            EXIT
  251.                     
  252.                       OTHERWISE
  253.                            LOOP
  254.                    ENDCASE   
  255.                 ENDDO
  256.                 SEEK larea
  257.                 DO WHILE pic1 # ptemp
  258.                    SKIP 
  259.                 ENDDO
  260.                 DO reset
  261.                 RELEASE temp,ptemp
  262.                 LOOP
  263.            
  264.            CASE LastKey() = 86 .OR. LastKey() = 118   && V or v: View Tagged
  265.                 temp = crow
  266.                 ptemp = pic1
  267.                 
  268.                 IF tarray[1] # "EMPTY"
  269.                    DO lview
  270.                    SET COLOR TO R/R
  271.                    @ 0,0 CLEAR TO 1,60
  272.                    SET COLOR TO GR+/R
  273.                    @ 0,3 SAY city
  274.                    @ 0,Col()+1 SAY "Real Estate Listings in Area"
  275.                    @ 0,Col()+1 SAY larea
  276.                    SET COLOR TO W+/R 
  277.                    @ 0,73 SAY "LIST  "
  278.                 ELSE
  279.                    DO cls WITH 2,0,20,79
  280.                    DO BoxB WITH 5,16,10,62
  281.                    @ 6,18 SAY "No listings have been tagged for download."
  282.                    @ 8,18 SAY "To tag listings, Select 'T' in List Screen,"
  283.                    @ 9,18 SAY "or use Search to find desired listings."
  284.                    Key =InKey(10)
  285.                 ENDIF   
  286.                 SEEK larea
  287.                 DO WHILE pic1 # ptemp
  288.                    SKIP 
  289.                 ENDDO
  290.                 DO reset
  291.                 RELEASE temp,ptemp
  292.                 LOOP
  293.                 
  294.            CASE LastKey() = 83 .OR. LastKey() = 115      && S or s: Search 
  295.                 temp = crow
  296.                 ptemp = pic1
  297.                 
  298.                 DO sscr
  299.                 SET COLOR TO GR+/R
  300.                 @ 0,3 SAY "Search in Area "+larea
  301.                 DO search WITH 4
  302.                 
  303.                 SELECT a
  304.                 SET FORMAT TO fscr NOCLEAR
  305.                 SET COLOR TO R/R
  306.                 @ 0,0 CLEAR TO 1,60
  307.                 SET COLOR TO GR+/R
  308.                 @ 0,3 SAY city
  309.                 @ 0,Col()+1 SAY "Real Estate Listings in Area"
  310.                 @ 0,Col()+1 SAY larea
  311.                 SET COLOR TO W+/R 
  312.                 @ 0,73 SAY "LIST  "
  313.                 SEEK larea
  314.                 DO WHILE pic1 # ptemp
  315.                    SKIP 
  316.                 ENDDO
  317.                 DO reset
  318.                 RELEASE temp,ptemp
  319.                 LOOP
  320.  
  321.            CASE LastKey() = 84 .OR. LastKey() = 116      && T or t: Tag
  322.                 DO ltag
  323.            
  324.            OTHERWISE 
  325.                 LOOP
  326.         ENDCASE
  327. ENDDO
  328. RETURN
  329.  
  330.  
  331.  
  332.  
  333. PROCEDURE reset                
  334.  
  335. DO cls WITH 2,0,20,79
  336. DO tl
  337. IF crec # 1
  338.    SKIP -(crec-1)
  339. ENDIF
  340. DO nlist WITH brow,more,brec 
  341. SKIP crec-brec
  342. SET COLOR TO GR+/B
  343. crow=temp
  344. @ crow,9 SAY " $"
  345. @ crow,11 SAY price PICTURE "@B 9,999,999"
  346. RETURN
  347.  
  348.  
  349. PROCEDURE nlist
  350. PARAMETERS brow,more,brec
  351.  
  352. rec = 0
  353. crow = 2
  354. DO WHILE  crow < 19 
  355.          crow = crow + 1
  356.          rec = rec + 1
  357.          
  358.          fnd=aScan(tarray,pic1)
  359.          IF fnd # 0
  360.             SET COLOR TO RB+/N
  361.             @ crow,1 SAY "*"
  362.          ENDIF
  363.          
  364.          SET COLOR TO GR+/N
  365.          @ crow,3 SAY "["
  366.          @ crow,4 SAY pic1
  367.          @ crow,7 SAY "]"
  368.          
  369.          SET COLOR TO W+/N
  370.          @ crow,9 SAY " $"
  371.          @ crow,11 SAY price PICTURE "@B 9,999,999"
  372.          
  373.          SET COLOR TO G/N                         
  374.          @ crow,21 SAY RTrim(sub) + " - "
  375.          @ crow,Col()+1 SAY RTrim(design)+"," 
  376.          @ crow,Col()+1 SAY beds PICTURE "@Z 9"
  377.          @ crow,Col()+1 SAY "bed,"
  378.          @ crow,Col()+1 SAY baths PICTURE "@Z 9"
  379.          IF .NOT. IsInt(baths)
  380.                 @ crow,Col()+1 SAY "1/2"
  381.          ENDIF
  382.          @ crow,Col()+1 SAY "bath"
  383.             
  384.          SKIP
  385.          IF Eof() .OR. area # larea
  386.             more=.F.
  387.             EXIT  
  388.          ENDIF
  389. ENDDO
  390. SKIP -1
  391. brec = rec
  392. brow = crow
  393. SET COLOR TO GR+/B                          
  394. RETURN
  395.  
  396.